﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:b="clr-namespace:PokemonBattleOnline.PBO.Battle"
                    xmlns:ui="clr-namespace:PokemonBattleOnline.PBO.Elements">
    <Style TargetType="b:GameButton">
        <Setter Property="BorderThickness" Value="3"/>
        <Setter Property="Background" Value="#181818"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="b:GameButton">
                    <Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" UseLayoutRounding="True">
                        <Path Name="mask" Data="{TemplateBinding Shape}" Stroke="{x:Null}" Fill="Transparent" HorizontalAlignment="Left" VerticalAlignment="Top" Stretch="None" StrokeThickness="0" IsHitTestVisible="True"/>
                        <Image Name="main" Source="{TemplateBinding Image}" Stretch="Fill" Margin="{TemplateBinding Padding}" IsHitTestVisible="False"/>
                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" IsHitTestVisible="False"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HorizontalFlip" Value="True">
                            <Setter TargetName="main" Property="LayoutTransform">
                                <Setter.Value>
                                    <MatrixTransform>
                                        <MatrixTransform.Matrix>
                                            <Matrix M11="-1" M22="1"/>
                                        </MatrixTransform.Matrix>
                                    </MatrixTransform>
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="mask" Property="LayoutTransform">
                                <Setter.Value>
                                    <MatrixTransform>
                                        <MatrixTransform.Matrix>
                                            <Matrix M11="-1" M22="1"/>
                                        </MatrixTransform.Matrix>
                                    </MatrixTransform>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="SimPressed" Value="False">
                            <Setter TargetName="main" Property="Margin" Value="0"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="main" Property="Opacity" Value="0.5"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type ui:NumericUpdown}">
        <Setter Property="MinWidth" Value="25"/>
        <Setter Property="MinHeight" Value="18"/>
        <Setter Property="HorizontalContentAlignment" Value="Right"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="SmallChange" Value="1"/>
        <Setter Property="LargeChange" Value="1"/>
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ui:NumericUpdown}">
                    <Grid x:Name="grid" Background="Transparent">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBox Name="PART_TextBox" Foreground="{TemplateBinding Foreground}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" FontFamily="Microsoft YaHei" BorderThickness="0" Background="{x:Null}" BorderBrush="{x:Null}" Padding="0,3" Margin="0,0,21,0" Grid.RowSpan="2"/>
                        <Button Name="PART_IncreaseButton" Visibility="Collapsed" HorizontalAlignment="Right" Width="21">
                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <Grid Background="Transparent">
                                        <Polygon x:Name="tri" Points="0,4 7,4 3.5,0" Fill="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Grid>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter TargetName="tri" Property="Fill" Value="#c89098"/>
                                        </Trigger>
                                        <Trigger Property="IsPressed" Value="True">
                                            <Setter TargetName="tri" Property="Fill" Value="#800000"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Button.Template>
                        </Button>
                        <Button Name="PART_DecreaseButton" Visibility="Collapsed" HorizontalAlignment="Right" Width="21" Grid.Row="1">
                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <Grid Background="Transparent">
                                        <Polyline x:Name="tri" Points="0,0 7,0 3.5,4" Fill="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Grid>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter TargetName="tri" Property="Fill" Value="#9090d0"/>
                                        </Trigger>
                                        <Trigger Property="IsPressed" Value="True">
                                            <Setter TargetName="tri" Property="Fill" Value="#000080"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Button.Template>
                        </Button>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="grid" Property="Background" Value="#20000000"/>
                            <Setter TargetName="PART_DecreaseButton" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="PART_IncreaseButton" Property="Visibility" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>